import 'package:flutter/material.dart';

import 'GradientButton.dart';


void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text("Animation Widget Demo"),
      ),
      body: GradientButtonWidget(),
    ),
  ));
}

class GradientButtonWidget extends StatefulWidget {
  const GradientButtonWidget({Key? key}) : super(key: key);

  @override
  _GradientButtonWidgetState createState() => _GradientButtonWidgetState();
}

class _GradientButtonWidgetState extends State<GradientButtonWidget> {


  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        GradientButton(
          colors: const [Colors.orange, Colors.red],
          height: 50.0,
          onPressed: onTap,
          child: const Text('submit'),
        ),
        GradientButton(
          height: 50.0,
          colors: [Colors.lightGreen, Colors.green.shade700],
          onPressed: onTap,
          child: const Text('submit'),
        ),
        GradientButton(
          height: 50.0,
          colors: [Colors.lightBlue.shade300, Colors.blueAccent],
          onPressed: onTap,
          borderRadius: const BorderRadius.all(Radius.circular(5)),
          child: const Text('submit'),
        ),
        const GradientButton(
          height: 50,
          child: Text('submit'),
        ),
      ],
    );
  }

  void onTap() {
    print('button click');
  }
}
